package com.yf.activity.mapper;

import com.yf.activity.domain.DrMemberFavourable;
import org.apache.ibatis.annotations.Select;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface DrMemberFavourableDAO {

	@Select("select * from dr_member_favourable where uid = #{uid}")
	List<DrMemberFavourable> getMemberFavourableListByUid(Integer uid);

	/**
	 * 插入用户优惠券
	 * @param drMemberFavourable
	 * @throws SQLException
	 */
    void insertIntoInfo(DrMemberFavourable drMemberFavourable) throws SQLException;

    /**
	 * 获取用户优惠券列表
	 * @param map
	 * @return
	 */
    List<DrMemberFavourable> getMemberFavourableByParam(Map<String, Object> map);

    /**
	 * 获取用户优惠券统计
	 * @param map
	 * @return
	 */
	Integer getMemberFavourableTotal(Map<String, Object> map);
	
    void updateFavourableStatus(DrMemberFavourable drMemberFavourable);
	
	/**
	 * 批量插入优惠券
	 * @param list
	 */
	void batchInsert(List<DrMemberFavourable> list);
	
	/**
	 * 获取活动大礼包
	 * @param map
	 */
    List<DrMemberFavourable> getMemberFavourableByValentine(Map<String, Object> map);

    @Select("select * from dr_member_favourable where id = #{id}")
    DrMemberFavourable getById(Integer id);

	/**
	 * 查询优惠券信息
	 * @param id 优惠券主键ID
	 * @return
	 */
	DrMemberFavourable selectByPrimaryKey(Integer id);
}
